<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Blob 用作 URL</title>
	</head>
	<body>
		<!-- download 特性(attribute) 强制浏览器下载而不是导航 -->
		<a download="hello.txt" href="#" id="link">Download</a>

		<script>
			const blob = new Blob(['Hello World!', '你好 世界！'], { type: 'text/plain' })

			link.href = URL.createObjectURL(blob)
		</script>
	</body>
</html>
